package net.atomarrow.pr.interceptor;

import net.atomarrow.aop.ControllerInterceptor;
import net.atomarrow.action.ActionInvocation;
import net.atomarrow.render.Render;

public class PermissionInterceptor implements ControllerInterceptor {

	@Override
	public Render intercept(ActionInvocation actionInvocation) throws Exception {
//	    Action action= actionInvocation.getAction();
//	    if(!action.getMethod().isAnnotationPresent(UnCheck.class)){
//    	    String url =action.getMappingUrl();
//    	    boolean isSafe = PermissionCheckUtil.checkUrl(url);
//    	    if(isSafe==false){
//    	        return actionInvocation.getController().renderJsp("/permission/nopermission");
//    	    }
//        }
		return actionInvocation.invoke();
	}

}
